<?php
require_once '../etc/define.php';
require_once '../lib/G.php';
require_once 'GBook.php';

ini_set('memory_limit', '256M');

$Gbook = new GBook();
//echo $Gbook->login(); exit;

//$file = fopen("/home/dean/dbook/zh_books.txt", "r");
$file = fopen("b.txt", "r");
$i = 1;
while(!feof($file)){
	$h = trim(fgets($file));
	$s = mb_convert_encoding($h, 'gb2312','auto');
	$r = $Gbook->search($s);
	if($r)$Gbook->spiltBook();
	file_put_contents('run.log', $h.'|index:'.$i."\n", FILE_APPEND);
	$i++;
}

//$s = mb_convert_encoding("神印王座", 'gbk','utf8');

//echo $Gbook->search($s)."\n";

//echo $Gbook->spiltBook()."\n";

//print_r(json_decode(file_get_contents('info/9043.txt'),true));
